<template>
    <div class="table">
        <div class="panel-container">
          <div class="panel-title">个人中心</div>
          <div class="panel-content">
              <div>Hi：{{user}}</div>
              <div>Last Login Time：{{createTime}}</div>
              <div>版权归BTM所有</div>
          </div>
        </div>

        <div class="panel-container">
          <div class="panel-title">服务助手</div>
          <div class="panel-content">
              <div><i class="iconfont icon-lianxifangshi"></i>021-88888888</div>
              <div><i class="iconfont icon-youxiang"></i>btm@163.com</div>
          </div>
        </div>

    </div>
</template>

<script>
import * as rpConfig from "../../../../rpConfig/constant";
import { HttpReq } from "../../../service/server";
import * as Login from '@/service/login';
var Server = new HttpReq();
export default {
  data() {
    return {
      ugcData: [],
      typeCenter: [],
      user:'管理员',
      createTime:'yyyy-mm-dd dd:mm:ss',
      cur_page: 1,
      all_page: 1,
      activityId: "",
      orderBy: "",
      del_list: "",
      offset: 10,
      select_cate:'',
      is_search: false
    };
  },
  mounted() {
    var user=Login.getLogin();
    this.user=user.loginName;
    this.createTime=user.lastLoginTime;
   // this.getData();
   // this.$emit('watchRouter',"test-router-link")
    //this.getType();
  },
  computed: {},
  methods: {
    handleCurrentChange(val) {
      this.cur_page = val;
      this.getData();
    },
    getData() {
      let self = this;
      Server._REQUEST_JSON(
        rpConfig.API_URI + "/ugc/r/list",
        {
          lastUgcNo: self.cur_page==1?0:self.newsCenter[self.cur_page*self.offset-1].ugcNo,
          a_type_id: self.select_cate,
          offset:self.offset,
          orderBy:self.orderBy
        },
        function(res) {
          self.ugcData = res.data;
          //console.log( self.ugcData)
          self.all_page = Math.ceil(res.data.num / res.data.pagesize) * 10;
        },'get'
      );
    },
    getType() {
      let self = this;
      Server._POST(
        rpConfig.API_URI + "/activity/r/list",
        {},
        function(response) {
          self.typeCenter = response.data;
        }
      );
    },
    time_filter(row) {
      return row.a_publish_time.substring(0, 16);
    },
    publish_formatter(row) {
      return row.a_state == 1 ? "上线内容" : "草稿";
    },
    filterTag(value, row) {
      return row.tag === value;
    },
    handleEdit(row) {
      this.$router.push("/newsedit/" + row.a_id);
      //this.$message('编辑第' + (index + 1) + '行')
    },
    handleInTop(row) {
      let self = this;
      Server._POST(
        rpConfig.API_URI + "/newscenter.Index/setInTop",
        { item_id: row.a_id, a_top: row.a_top },
        function(response) {
          self.$message.success(response.msg);
          self.getData();
        }
      );
    },
    handleDelete(row) {
      let self = this;
      Server._POST(
        rpConfig.API_URI + "/newscenter.Index/deleteNewsItem",
        { item_id: [row.a_id] },
        function(response) {
          self.$message.success(response.msg);
          self.getData();
        }
      );
    },
    delAll() {
      const self = this,
        length = self.multipleSelection.length;
      let delArr = [];
      for (let i = 0; i < length; i++) {
        delArr.push(self.multipleSelection[i].a_id);
      }
      if (delArr.length == 0) {
        self.$message.info("请选择要删除的记录");
      } else {
        Server._POST(
          rpConfig.API_URI + "/newscenter.Index/deleteNewsItem",
          { item_id: delArr },
          function(response) {
            self.$message.success(response.msg);
            self.getData();
          }
        );
      }

      self.multipleSelection = [];
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    }
  }
};
</script>

<style scoped>
/* 数据列表 */
.panel-container{
    width:250px;
    height:200px;
    border:1px solid #E7EEF0;
    padding:0;
    float: left;
    margin-right:20px;
}
.panel-title{
    background:#E7EEF0;
    
}
.panel-title,.panel-content{
    padding:10px 20px;
}
.iconfont{
    margin-right:5px;
    color:rgb(217, 122, 93);
}
</style>